{include_core file="lib/header.html" center="center" title="修改个人资料"}
{include_core file="lib/top_nav.html" }
      <div class="container">
        <div class="inner">
          <div class="con-top clearfix">
            {include_core file="lib/sidebar.html" crumbs_1="center" crumbs_2="user_info"}
            <div class="section-right personal-data">
              <div class="personal-infor">
                <div class="top clearfix">
                  <h2>基本信息修改</h2>
                </div>
                <div class="base-infor editor-infor">
                    <form action="{AnUrl('user/setting/save')}" id="saveForm" method="post">
                      <p>
                        <span class="name">用户ID</span>
                        <span class="con">{$user_info.id}</span>
                      </p>
                      <p>
                        <span class="name">用户名</span>
                        {if $user_info.edit_user_num == 0}
                        <span class="txt-box"><input type="text" name="username" id="userName" value="{$user_info.user_name}" class="txt1" /></span>
                        <span class="warm-prompt">温馨提示：用户名只能修改一次</span>
                        {else}
                        <span class="con">{$user_info.user_name}</span>
                        {/if}
                      </p>
                      <p>
                        <span class="name">昵称</span>
                        <span class="txt-box"><input type="text" id="nickName" name="nickname" value="{$user_info.nickname}" class="txt1" /></span>
                      </p>
                      <p>
                        <span class="name">真实姓名</span>
                        <span class="txt-box"><input type="text" id="realName" name="realname" value="{$user_info.realname}" class="txt1" /></span>
                      </p>
                      <p>
                        <span class="name">性别</span>
                        <span class="con radio-box">
                          <label><i class="radio-bg {if $user_info.gender == '1'} checked {/if}"></i><input type="radio" name="gender" class="radio1" value = "1" {if $user_info.gender == '1'} checked {/if}/>男</label>
                          <label><i class="radio-bg {if $user_info.gender == '0'} checked {/if}"></i><input type="radio" name="gender" class="radio1" value = "0" {if $user_info.gender == '0'} checked {/if}/>女</label>
                          <label><i class="radio-bg {if $user_info.gender == '2'} checked {/if}"></i><input type="radio" name="gender" class="radio1" value = "2" {if $user_info.gender == '2'} checked {/if}/>保密</label>
                        </span>
                      </p>
                      <p>
                        <span class="name">生日</span>
                        <span class="txt-box"><input type="text" id="birthdayDate" name="birthday" {if $user_info.birthday != '0000-00-00' && $user_info.birthday != ''}value="{$user_info.birthday}"{/if} class="txt1" /></span>
                      </p>
                      <p class="btns"><a href="javascript:void(0);" class="save-btn">保存</a></p>
                    </form>
                  </div>
                </div>
              </div>
              <!--personal-infor  end-->
            </div>
            <!--personal-data  end-->
            
          </div>
          <!--con-top  end-->
        </div>
        <!--inner  end-->
        <script type="text/javascript">
          $(function(){
            $('.save-btn').click(function(){
              {if $user_info.edit_user_num < user_config::$edit_user_num}
              var username = htmlSpecialChars($.trim($('#userName').val()));
              {else}
              var username = '';
              {/if}
              var nickname = htmlSpecialChars($.trim($('#nickName').val()));
              var realname = htmlSpecialChars($.trim($('#reanName').val()));
              var birthdayDate = htmlSpecialChars($.trim($('#birthdayDate').val()));
              var datas = { username:username, nickname:nickname, realname:realname, birthday:birthdayDate }
              $.post("{AnUrl('user/setting/save')}",datas,
                function(data){
                  if(data.info == 'error') {
                    showMsg(data.msg);
                    return;
                  } else {
                    $('#saveForm').submit();
                  }
                }, 'json');
            });
            $('.radio-bg').click(function(){
              $('.radio-bg').removeClass('checked');
              $('.radio1').removeAttr('checked');
              $(this).addClass('checked');
              $(this).next().attr('checked', 'checked');
            });  
            //$('#birthdayDate').datepicker({ changeYear: true });

            $("#birthdayDate").datepicker({
              dateFormat: 'yy-mm-dd',
              showButtonPanel: true,
              yearRange: '1900:'+new Date().getFullYear(),
              changeYear:true,
              changeMonth:true,
              maxDate: new Date(),
              yearSuffix: ''
            });
  
          });
        </script>
{include_core file="lib/footer.html"}
